package objects;

import java.io.Serializable;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Named;
import javax.security.auth.Subject;

/**
 * Created with IntelliJ IDEA.
 * User: Casper
 * Date: 19-04-12
 * Time: 11:36
 * To change this template use File | Settings | File Templates.
 */
@Named
@ApplicationScoped

public class Thread implements Serializable {
    private User user;
    private Category category;

    private String subject;
    
    public Thread(User user, Category category, String subject, String text)
    {
    	this.user = user;
    	this.category = category;
    	this.subject = subject;
    	
    	Post tmpPost = new Post(user,text,this);
    	tmpPost.save();
    }
    
    public User getUser()
    {
    	return user;
    }
    
    public Category getCategory()
    {
    	return category;
    }
    public void setCategory(Category category)
    {
    	this.category = category;
    }
    
    public String getSubject()
    {
    	return subject;
    }
    public void setSubject(String subject)
    {
    	this.subject = subject;
    }
}
